package com.jrx.anytxn.param.service.product;

import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.i18n.response.TxnPage;
import com.jrx.anytxn.param.dto.product.PrBlockCodeReq;
import com.jrx.anytxn.param.dto.product.PrBlockCodeRes;
import com.jrx.anytxn.param.entity.PrBlockCode;

import java.util.List;

/**
 * @author liuyu
 * @Description
 */
public interface IPrBlockCodeService {

    /**
     * 根据租户ID和封锁码查询封锁码表信息
     *
     * @param tenantId
     * @param blockCode
     * @return
     * @throws TxnException
     */
    PrBlockCodeRes findByTenIdAndBlockCode(String tenantId, String blockCode) throws TxnException;

    /**
     * 根据租户ID分页查询封锁码表信息
     *
     * @param pageNum
     * @param pageSize
     * @param tenantId
     * @return
     * @throws TxnException
     */
    TxnPage<PrBlockCodeRes> findAllPageByTenantId(Integer pageNum, Integer pageSize, String tenantId) throws TxnException;

    /**
     * 新增封锁码表信息
     *
     * @param prBlockCodeReq
     * @return
     * @throws TxnException
     */
    PrBlockCodeRes addPrBlockCode(PrBlockCodeReq prBlockCodeReq) throws TxnException;

    /**
     * 修改封锁码表信息
     *
     * @param prBlockCodeReq
     * @return
     * @throws TxnException
     */
    PrBlockCodeRes modifyPrBlockCode(PrBlockCodeReq prBlockCodeReq) throws TxnException;

    Boolean removeByTenIdAndBlockCode(String tenantId, String organizationId, String blockCode) throws TxnException;

    /**
     * 查询封锁码
     * @param tenantId
     * @param blockCode
     * @return
     * @throws TxnException
     */
    PrBlockCode findByBlockCode(String tenantId, String blockCode) throws TxnException;


    /**
     * 获取所有封锁码
     * @param tenantId
     * @return
     * @throws TxnException
     */
    List<PrBlockCodeRes> findAllBlockCodeByTenId(String tenantId);

}
